import { request } from '@/utils/request'

// 获取直播视频流
export const getVideoList = (classRoomNo: any, userName: any) =>
  request<any>(
    `/aicourse/video/getLiveUrls?classRoomNo=${classRoomNo}&userName=${userName}`,
    'GET'
  )

// 在线听课列表
export const getListencourseList = (
  pageNum: number,
  pageSize: number,
  searchValue: string,
  grade: number
) =>
  request<any>(
    `/aicourse/jskcToday/listLive?pageNum=${pageNum}&pageSize=${pageSize}&searchValue=${searchValue}` +
      `${grade !== null && grade !== undefined ? `&isYjs=${grade}` : ''}`,
    'GET'
  )

// 获取课程详情
export const getcourseDetail = (id: any) =>
  request<any>(`/aicourse/jskcToday/detail/${id}`, 'GET')

// 获取核心要点
export const getKeypoint = (
  classRoomNo: any,
  viewDate: any,
  classSeq: any,
  kch: any
) =>
  request<any>(
    `/aicourse/aiKnowledgeGraph/getKnowledge?classRoomNo=${classRoomNo}&viewDate=${viewDate}&classSeq=${classSeq}&kch=${kch}`,
    'GET'
  )

// 获取ppt
export const getPpt = (classRoomNo: any, viewDate: any, classSeq: any) =>
  request<any>(
    `/aicourse/courseImg/getPptList?classRoomNo=${classRoomNo}&date=${viewDate}&classSeq=${classSeq}`,
    'GET'
  )

// 获取抓图列表
export const getPictures = (classRoomNo: any, viewDate: any, classSeq: any) =>
  request<any>(
    `/aicourse/courseImg/getBetaList?classRoomNo=${classRoomNo}&viewDate=${viewDate}&classSeq=${classSeq}`,
    'GET'
  )

// 获取课程播放状态
export const getCoursePlay = (classRoomNo: any, date: any, classSeq: any) =>
  request<any>(
    `/aicourse/video/getStatus?classRoomNo=${classRoomNo}&date=${date}&classSeq=${classSeq}`,
    'GET'
  )

// 获取听课记录详情
export const getCourseScore = (id: any) =>
  request<any>(`/aicourse/courseScore/${id}`, 'GET')

// PPT抓图
export const getCapturePicture = (
  classRoomNo: any,
  date: any,
  classSeq: any,
  timestamp: any
) =>
  request<any>(
    `/aicourse/courseImg/snapshotPpt?classRoomNo=${classRoomNo}&date=${date}&classSeq=${classSeq}&timestamp=${timestamp}`,
    'POST'
  )

// 删除ppt
export const delPpt = (pptUrl: any, date: any) =>
  request<any>(
    `/aicourse/courseImg/ppt?pptUrl=${pptUrl}&date=${date}`,
    'DELETE'
  )

// 重新生成PPT
export const generatePpt = (data: any) =>
  request<any>(`/aicourse/courseImg/rebuildPpt`, 'POST', {
    ...data
  })

// 保存视频观看记录
export const saveRecord = (data: any) =>
  request<any>(`/aicourse/videoWatchRecord`, 'POST', { ...data })
